import time
from public.action import *
from public.business import *
from public.testData import *
from public.tools import *
testCase = "DBshop022_删除品牌"

# 调用函数 实例化浏览器对象 打开指定网址
driver = openBrowser(urlAdmin)
# 调用函数登录后台
DBshopLoginAdmin(driver)
# 处理三级菜单
DBshopEnterMenu2(driver,'商品管理','商品品牌')
# 定位到删除
driver.find_element_by_xpath("//td[contains(.,'%s')]/following-sibling::td[4]/a[2]"%pinpai).click()
time.sleep(1)
driver.switch_to.alert.accept()
time.sleep(2)
try:
    driver.find_element_by_xpath('//td[contains(.,"%s")]'%pinpai).is_displayed()
    writeLog("%s 测试失败"%testCase)
    getPhoto(driver)
except:
    writeLog("%s 测试通过" % testCase)
driver.quit()
